// const utils = require('../utils/utils');

// 获取当前日期时间
const getNowDateTime = () => {
    const now = new Date();

    // 获取年月日
    const year = now.getFullYear();
    const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始，需 +1
    const day = String(now.getDate()).padStart(2, '0');

    // 获取时分秒
    const hours = String(now.getHours()).padStart(2, '0');
    const minutes = String(now.getMinutes()).padStart(2, '0');
    const seconds = String(now.getSeconds()).padStart(2, '0');

    // 格式化为 YYYY-MM-DD HH:mm:ss
    const formattedDateTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    return formattedDateTime
};

module.exports = {
    getNowDateTime
};
